from django.db import models
from datetime import date


class Student(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    name = models.CharField(max_length=20,
                            unique=True,
                            default="")
    age = models.IntegerField()
    address = models.CharField(max_length=100,
                               blank=True,
                               default="")

    class Meta:
        ordering = ('created',)


class Article(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    title = models.CharField(max_length=200,
                             unique=True,
                             default="")
    date = models.DateField(default=date.today)
    author = models.CharField(max_length=20,
                              blank=True,
                              default="")
    keyword = models.CharField(max_length=100,
                               blank=True,
                               default="")

    class Meta:
        ordering = ('created',)

